<link rel="StyleSheet" href="/css/dtree.css" type="text/css" />
<script type="text/javascript" src="/js/dtree.js"></script>
<script type="text/javascript" >
function finishScore() {
  if(confirm('确定已评分完成吗？确定完成以后将不能修改！')) {
    location.href="/judge/completeScore.do?projectId=$!project.id";
  }
}
function judgescoure(inputname,score)
{	
	var old_score = parseFloat(document.getElementsByName(inputname)[0].value);
	document.getElementsByName(inputname)[0].value=parseFloat(score)+old_score;
}
</script>
<style type="text/css">
#main table {
	border-top:1px #666666 solid;
	border-right:1px #666666 solid;
}
#main table tr:hover td { background: #FFFB82; cursor:pointer; color:#000000;}/*隔行换色鼠标经过效果*/
#main td {
	border-left:1px #666666 solid;
	border-bottom:1px #666666 solid;
	height:29px;
	overflow:hidden;
}
</style>
<form action="/judge/saveScore.do" method="post">
<input type="hidden" name="treeId" value="$tree.id" />
<input type="hidden" name="projectId" value="$project.id" />
<table width="90%" style="margin-top:20px;" border="0" align="center" cellpadding="10" cellspacing="0">
	<tr>
		<td>
		<div id="main">

			<h3>项目评分</h3>
			<fieldset>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr style="color:#FFFFFF">
						<td height="30" colspan="4" align="left" valign="middle" bgcolor="#333333">　<strong>项目基本信息</strong></td>
			    	</tr>
					<tr>
                      <td width="10%" height="30" align="center">项目名称:</td>
					  <td width="40%">&nbsp;$!project.name</td>
					  <td width="10%" align="center">项目状态:</td>
					  <td width="40%">&nbsp; #if($!project.status==0)建立中#elseif($!project.status==1)评分中#else已结束#end</td>
				  </tr>
					<tr>
                      <td height="30" align="center">建设单位:</td>
					  <td>&nbsp;$!project.buildUnit</td>
					  <td align="center">施工单位:</td>
					  <td>&nbsp;$!project.constructUnit</td>
				  </tr>
					<tr>
                      <td height="30" align="center">设计单位:</td>
					  <td>&nbsp;$!project.designUnit</td>
					  <td align="center">监理单位:</td>
					  <td>&nbsp;$!project.supervisorUnit</td>
				  </tr>
					<tr>
					  <td height="50" align="center">评分人员:</td>
				      <td>&nbsp;$user.realName</td>
				      <td align="center">开始时间:</td>
				      <td>&nbsp;$DateUtil.formatDate($!project.startTime,"yyyy-MM-dd") </td>
			    	</tr>
				</table>
				<h3 style="margin-top:10px;"></h3>
				<div style="width:100%;">
					<ul>
						<li style="width:30%; float:left;">
						<div class="dtree">
											<p>
												<a href="javascript: d.openAll();">全部展开</a> |
												<a href="javascript: d.closeAll();">全部收起</a>
											</p>
                      <script type="text/javascript">
                      <!--
                        d = new dTree('d');
                        d.add(0, -1, '评分项目');

							          #foreach($tree in $treeList)
							            #if($tree.hasScoreItem==true)
							              #if($allProjectItemTreeMap.containsKey($tree.id))
							              d.add($tree.id, $tree.pid, '$tree.cateName', '/judge/scoreProjectByPerson.jsp?projectId=$project.id&treeId=$tree.id','','_self');
							              #end
							            #else
							              d.add($tree.id, $tree.pid, '$tree.cateName', '/judge/scoreProjectByPerson.jsp?projectId=$project.id&treeId=$tree.id','','_self','/images/folder.gif', '/images/folderopen.gif');
							            #end
							          #end
                        
                        document.write(d);
                      //-->
                      </script>
										</div>
						</li>
						<li style="width:70%; float:left;">
						<div style="width:100%; background-color:#333333; color:#FFFFFF; line-height:30px; vertical-align:middle;">　<strong>评分项列表</strong></div>
						<table width="100%" border="0" cellpadding="5" cellspacing="0">
				   <tr style="color:#FFFFFF">
					<td width="15%" align="center" valign="middle" bgcolor="#333333"><strong>所属项目</strong></td>
				    <td width="60%" align="center" valign="middle" bgcolor="#333333"><strong>评价名称</strong></td>
				    <td width="10%" align="center" valign="middle" bgcolor="#333333"><strong>设定分值</strong></td>
				    <td width="15%" align="center" valign="middle" bgcolor="#333333"><strong>扣分</strong></td>
				  </tr>
				  #foreach($item in $itemList)
				  <tr>
                    <td align="center" valign="middle">$tree.cateName</td>
				    <td align="left" valign="middle">
				    $item.scoreItem.itemName
				                      <br />
				                      合格参考：
				                      #if("$!item.scoreItem.itemUrlDesc"=="")
				                      <a href="javascript:void(0);" title="$item.scoreItem.itemDesc"><span style="color: #FF0000;">标准</span></a>
				                      #else
				                      <a href="/system/itemDesc.jsp?id=$item.scoreItem.id" target="_blank" title="$item.scoreItem.itemDesc--点击查看详细"><span style="color: #FF0000;">标准</span></a>
				                      #end					
				    </td>
				    <td align="center" valign="middle">$item.score</td>
				    <td align="center" valign="middle">
				     #if($hasScoreItemMap.containsKey($item.scoreItem.id))
										          <input type="text" name="decScore_$item.scoreItem.id" value="$hasScoreItemMap.get($item.scoreItem.id).decScore" size="5" /> <a href="javascript:void(0)" onclick="judgescoure('decScore_$item.scoreItem.id','$item.score');">扣分</a>
										          #else
										          <input type="text" name="decScore_$item.scoreItem.id" value="0" size="5"  /> <a href="javascript:void(0)" onclick="judgescoure('decScore_$item.scoreItem.id','$item.score');">扣分</a>
										          #end
				    </td>
			      </tr>
				   #end
				   #if($!itemList.size()>0)
				  <tr>
				    <td height="30" colspan="4" valign="middle" align="center">　  <input type="submit" name="Submit" value="提交保存" />  </td>
			      </tr>
			      #end
				</table>
						</li>
					</ul>
				</div>
				<div style="width:100%; float:left; height:30px; line-height:30px; vertical-align:middle; margin-top:10px; padding-top:10px; border-top:1px #333333 solid;">　
				&nbsp;当前项目共<span style="color:red">$!project.projectItemses.size()</span>项检查点，当前已扣分<span style="color:red">$!hasScoreItemSize</span>项 &nbsp;
										<input type="button" name="finish" value="完成评分" onclick="javascript:finishScore()" />
				</div>
			</fieldset>
		
		</div>
		</td>
	</tr>
</table>
</form>